﻿using Microsoft.FxCop.Sdk;

namespace Community.StaticAnalysis.Design.Rules
{
    internal static class Util
    {
        private readonly static TypeNode IDisposableType = FrameworkTypes.IDisposable;

        public static bool HasDisposableInterface(TypeNode node)
        {
            if (IDisposableType.FullName == node.FullName) { return true; }

            foreach (InterfaceNode interfaceNode in node.Interfaces)
            {
                if (IDisposableType.FullName == interfaceNode.FullName)
                {
                    return true;
                }
            }
            return false;
        }

    }
}